/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CollectActionPanel.java
 *
 * Created on 2011-4-29, 16:41:49
 */
package com.iduxs.collect.frame.collect;

/**
 *
 * @author Administrator
 */
public class CollectActionPanel extends javax.swing.JPanel {

    /** Creates new form CollectActionPanel */
    public CollectActionPanel() {
        initComponents();
    }

    public void setCollectAction(CollectAction ca) {
        downloadImagesFailModeItem.setSelectedItem(ca.getDownloadImagesFailMode());
        emptyChapterModeItem.setSelectedItem(ca.getEmptyChapterMode());
        lastChapterCompareModeItem.setSelectedItem(ca.getLastChapterCompareMode());
        repeatChapterModeItem.setSelectedItem(ca.getRepeatChapterMode());
        useAddNewBookBox.setSelected(ca.getUseAddNewBook());
        useAddSubsectionIfOneBox.setSelected(ca.getUseAddSubsectionIfOne());
        useAutoTypesettingChapterBox.setSelected(ca.getUseAutoTypesettingChapter());
        useCallPageAfterLoopBox.setSelected(ca.getUseCallPageAfterLoop());
        useCheckRepeatChapterBox.setSelected(ca.getUseCheckRepeatChapter());
        useClearIfChapterFailBox.setSelected(ca.getUseClearIfChapterFail());
        useClearRepeatCollectBox.setSelected(ca.getUseClearRepeatCollect());
        useDownloadImagesBox.setSelected(ca.getUseDownloadImages());
        useNoneFocusFinishedFictionBox.setSelected(ca.getUseNoneFocusFinishedFiction());
        useOnlyCollectTextChapterBox.setSelected(ca.getUseOnlyCollectTextChapter());
        useProhibitAddSubsectionBox.setSelected(ca.getUseProhibitAddSubsection());
        useUpdateSerialChapterBox.setSelected(ca.getUseUpdateSerialChapter());
    }

    public CollectAction getCollectAction() {
        CollectAction ca = new CollectAction();
        ca.setDownloadImagesFailMode(downloadImagesFailModeItem.getSelectedItem().toString().trim());
        ca.setEmptyChapterMode(emptyChapterModeItem.getSelectedItem().toString().trim());
        ca.setLastChapterCompareMode(lastChapterCompareModeItem.getSelectedItem().toString().trim());
        ca.setRepeatChapterMode(repeatChapterModeItem.getSelectedItem().toString().trim());
        ca.setUseAddNewBook(useAddNewBookBox.isSelected());
        ca.setUseAddSubsectionIfOne(useAddSubsectionIfOneBox.isSelected());
        ca.setUseAutoTypesettingChapter(useAutoTypesettingChapterBox.isSelected());
        ca.setUseCallPageAfterLoop(useCallPageAfterLoopBox.isSelected());
        ca.setUseCheckRepeatChapter(useCheckRepeatChapterBox.isSelected());
        ca.setUseClearIfChapterFail(useClearIfChapterFailBox.isSelected());
        ca.setUseClearRepeatCollect(useClearRepeatCollectBox.isSelected());
        ca.setUseDownloadImages(useDownloadImagesBox.isSelected());
        ca.setUseNoneFocusFinishedFiction(useNoneFocusFinishedFictionBox.isSelected());
        ca.setUseOnlyCollectTextChapter(useOnlyCollectTextChapterBox.isSelected());
        ca.setUseProhibitAddSubsection(useProhibitAddSubsectionBox.isSelected());
        ca.setUseUpdateSerialChapter(useUpdateSerialChapterBox.isSelected());
        return ca;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        useAddNewBookBox = new javax.swing.JCheckBox();
        useUpdateSerialChapterBox = new javax.swing.JCheckBox();
        useNoneFocusFinishedFictionBox = new javax.swing.JCheckBox();
        jCheckBox4 = new javax.swing.JCheckBox();
        useAutoTypesettingChapterBox = new javax.swing.JCheckBox();
        jCheckBox6 = new javax.swing.JCheckBox();
        useCallPageAfterLoopBox = new javax.swing.JCheckBox();
        useCheckRepeatChapterBox = new javax.swing.JCheckBox();
        useOnlyCollectTextChapterBox = new javax.swing.JCheckBox();
        useAddSubsectionIfOneBox = new javax.swing.JCheckBox();
        useProhibitAddSubsectionBox = new javax.swing.JCheckBox();
        useDownloadImagesBox = new javax.swing.JCheckBox();
        useClearIfChapterFailBox = new javax.swing.JCheckBox();
        useClearRepeatCollectBox = new javax.swing.JCheckBox();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        lastChapterCompareModeItem = new javax.swing.JComboBox();
        emptyChapterModeItem = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        repeatChapterModeItem = new javax.swing.JComboBox();
        downloadImagesFailModeItem = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        useAddNewBookBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useAddNewBookBox.setSelected(true);
        useAddNewBookBox.setText("添加新书");

        useUpdateSerialChapterBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useUpdateSerialChapterBox.setSelected(true);
        useUpdateSerialChapterBox.setText("更新连载章节");

        useNoneFocusFinishedFictionBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useNoneFocusFinishedFictionBox.setSelected(true);
        useNoneFocusFinishedFictionBox.setText("不处理已完成小说");

        jCheckBox4.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        jCheckBox4.setText("自动整理分卷名和章节名");
        jCheckBox4.setEnabled(false);

        useAutoTypesettingChapterBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useAutoTypesettingChapterBox.setSelected(true);
        useAutoTypesettingChapterBox.setText("自动排版章节内容");

        jCheckBox6.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        jCheckBox6.setText("以“书名+作者”识别书籍");
        jCheckBox6.setEnabled(false);

        useCallPageAfterLoopBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useCallPageAfterLoopBox.setText("单次循环后调用页面");

        useCheckRepeatChapterBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useCheckRepeatChapterBox.setSelected(true);
        useCheckRepeatChapterBox.setText("检测重复章节");

        useOnlyCollectTextChapterBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useOnlyCollectTextChapterBox.setText("只采集文字章节");

        useAddSubsectionIfOneBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useAddSubsectionIfOneBox.setSelected(true);
        useAddSubsectionIfOneBox.setText("遇到“一1壹”才判读添加分卷");

        useProhibitAddSubsectionBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useProhibitAddSubsectionBox.setText("禁止添加分卷");

        useDownloadImagesBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useDownloadImagesBox.setSelected(true);
        useDownloadImagesBox.setText("下载图片本地化");

        useClearIfChapterFailBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useClearIfChapterFailBox.setText("对比最新章节失败自动清空重采（慎选）");

        useClearRepeatCollectBox.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        useClearRepeatCollectBox.setText("强制清空重采（慎选）");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(useAddNewBookBox)
                    .addComponent(useUpdateSerialChapterBox)
                    .addComponent(useNoneFocusFinishedFictionBox)
                    .addComponent(jCheckBox4)
                    .addComponent(useAutoTypesettingChapterBox)
                    .addComponent(jCheckBox6)
                    .addComponent(useCallPageAfterLoopBox))
                .addGap(72, 72, 72)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(useClearRepeatCollectBox)
                    .addComponent(useClearIfChapterFailBox)
                    .addComponent(useDownloadImagesBox)
                    .addComponent(useProhibitAddSubsectionBox)
                    .addComponent(useAddSubsectionIfOneBox)
                    .addComponent(useOnlyCollectTextChapterBox)
                    .addComponent(useCheckRepeatChapterBox))
                .addContainerGap(144, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(useClearRepeatCollectBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useClearIfChapterFailBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useDownloadImagesBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useProhibitAddSubsectionBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useAddSubsectionIfOneBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useOnlyCollectTextChapterBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useCheckRepeatChapterBox))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(useAddNewBookBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useUpdateSerialChapterBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useNoneFocusFinishedFictionBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCheckBox4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useAutoTypesettingChapterBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCheckBox6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(useCallPageAfterLoopBox)))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        jLabel1.setText("最新章节对比方式");

        lastChapterCompareModeItem.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        emptyChapterModeItem.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel2.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        jLabel2.setText("空章节处理方式");

        jLabel3.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        jLabel3.setText("重复章节判断方式");

        repeatChapterModeItem.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        downloadImagesFailModeItem.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel4.setFont(new java.awt.Font("宋体", 0, 12)); // NOI18N
        jLabel4.setText("下载图片失败处理方式");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(lastChapterCompareModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(emptyChapterModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(repeatChapterModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(downloadImagesFailModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(117, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lastChapterCompareModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(emptyChapterModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(repeatChapterModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(downloadImagesFailModeItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(21, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox downloadImagesFailModeItem;
    private javax.swing.JComboBox emptyChapterModeItem;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JComboBox lastChapterCompareModeItem;
    private javax.swing.JComboBox repeatChapterModeItem;
    private javax.swing.JCheckBox useAddNewBookBox;
    private javax.swing.JCheckBox useAddSubsectionIfOneBox;
    private javax.swing.JCheckBox useAutoTypesettingChapterBox;
    private javax.swing.JCheckBox useCallPageAfterLoopBox;
    private javax.swing.JCheckBox useCheckRepeatChapterBox;
    private javax.swing.JCheckBox useClearIfChapterFailBox;
    private javax.swing.JCheckBox useClearRepeatCollectBox;
    private javax.swing.JCheckBox useDownloadImagesBox;
    private javax.swing.JCheckBox useNoneFocusFinishedFictionBox;
    private javax.swing.JCheckBox useOnlyCollectTextChapterBox;
    private javax.swing.JCheckBox useProhibitAddSubsectionBox;
    private javax.swing.JCheckBox useUpdateSerialChapterBox;
    // End of variables declaration//GEN-END:variables
}
